package pl.edu.agh.transstat.parsing;

import java.util.ArrayList;
import java.util.List;

public class StatData {
	private List<String> params;
	private List<String> functions;
	private boolean allParams;
	private boolean allFunctions;
	private boolean oneChart;

	public StatData() {
		this.params = new ArrayList<String>();
		this.functions = new ArrayList<String>();
	}
	
	public boolean isOneChart(){
		return oneChart;
	}

	public void setOneChart(boolean oneChart){
		this.oneChart = oneChart;
	}
	
	public List<String> getParams() {
		return params;
	}

	public void addParam(String param) {
		this.params.add(param);
	}

	public List<String> getFunctions() {
		if(oneChart){
			if(!functions.contains("Max")){
				functions.add("Max");
			}
			if(!functions.contains("Min")){
				functions.add("Min");
			}
			if(!functions.contains("Mean")){
				functions.add("Mean");
			}
			if(!functions.contains("dev")){
				functions.add("dev");
			}
		}
		return functions;
	}

	public void addFunction(String function) {
		this.functions.add(function);
	}

	public boolean isAllParams() {
		return allParams;
	}

	public void setAllParams(boolean allParams) {
		this.allParams = allParams;
	}

	public boolean isAllFunctions() {
		return allFunctions;
	}

	public void setAllFunctions(boolean allFunctions) {
		this.allFunctions = allFunctions;
	}

	public String toString() {
		StringBuilder sb = new StringBuilder();
		if (allFunctions) {
			sb.append("allFunctions");
		} else {
			for (String f : functions) {
				sb.append(f + " ");
			}
		}
		return sb.toString();
	}
}
